import {ZoeticCharacter} from "./ZoeticCharacter.js";
import {GoodsTypes} from "../enums/enum";

export class Monster extends ZoeticCharacter {
  /**
   * 用于存放怪物列表的容器
   * @type [Monster]
   */
  container

  /**
   * @type {Hero}
   */
  hero

  /**
   * 掉落物品集合
   * @type {[{type:GoodsTypeEnum,code:number,max:number,min:number}]}
   */
  dropOutEquipments = [
    {type:GoodsTypes.CUBE,code:1,max:30,min:10}
  ]

  /**
   * 上次攻击的时间戳
   * @type {number}
   */
  lastAttack = new Date().getTime()

  /**
   * 默认攻击间隔
   * @type {number}
   */
  attackInterval = 2000


  die(){
    let i = this.container.indexOf(this)
    this.container.splice(i,1)
    this.hero.receiveEquipments(this.dropOut)
  }

  attack = ()=>{

  }

  act = ()=>{

  }

}